<#include "/common/pagerForm.html"> 
<script src="${rc.getContextPath()}/manage/js/dwzCustomJs/dwz.custom.advancedquery.js?v=${ver}" type="text/javascript"></script>


<form name="repairOrderCondition" rel="pagerForm" method="post" action="" onsubmit="return navTabSearch(this)">
    <input type="hidden" id="advancedStatus" name="advancedStatus"
                value="${condition.advancedStatus!''}" />
    <input type="hidden" id="step" name="step"
                value="${step!''}" />
    <div class="pageHeader">
        <div class="searchBar poStatus">
            <ul class="searchContent">
                <li>
                    <label>
                        <@label key='repairOrderCode.C,colon'>维修单编号：</@label>
                    </label>
                    <input type="text" name="orderCode" value="${condition.orderCode!''}"/>
                </li>
                <li>
                    <label>
                        <@label key='equipmentCode.C,colon'>设备编号：</@label>
                    </label>
                    <input type="text" name="equipmentCode" value="${condition.equipmentCode!''}"/>
                </li>
                <li>
                    <label>
                        <@label key='equipmentText.C,colon'>设备描述：</@label>
                    </label>
                    <input type="text" name="equipmentText" value="${condition.equipmentText!''}"/>
                </li>
            </ul>
            <ul class="searchContent">
                <li>
                    <label>
                        <@label key='requestUser.C,colon'>维修单编号：</@label>
                    </label>
                    <input type="text" name="requestUser" value="${condition.requestUser!''}"/>
                </li>
                <li>
                    <label>
                        <@label key='repairStatusECode.C,colon'>处理状态：</@label>
                    </label>
                    <#if step??&&step&lt;4>
                    <select  name="statusECode"   >
                        <#if ECode??><#list ECode as eCode>
                        <option value="${eCode.eCode!''}" <#if  condition.statusECode==eCode.eCode>selected="selected"</#if>>${eCode.eCodeText!''}</option>
                        </#list></#if>
                    </select>
                    <#else>
                    <select  name="statusECode">
                        <option value="" ><@label key='all.C'>所有</@label></option>
                        <#if ECode??><#list ECode as eCode>
                        <option value="${eCode.eCode!''}" <#if  condition.statusECode==eCode.eCode>selected="selected"</#if>>${eCode.eCodeText!''}</option>
                        </#list></#if>
                    </select>
                    </#if>
                </li>
                <li>
                    <label>
                        <@label key='repairCategory.C,colon'>维修类别：</@label>
                    </label>
                        <input id="categoryCodeGrp.categoryCode"  name="categoryCode" type="text"  value="${repairOrder.categoryCode!''}"
                                   postField="categoryCode" suggestFields="categoryCode,categoryText" 
                                   suggestUrl="${rc.getContextPath()}/manage/repairCategory/repairCategoryDropdown" lookupGroup="categoryCodeGrp"/>
                    
                </li>
                <li class="query">
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                <@label key='query.B'>查询</@label>
                            </button>
                        </div>
                    </div>
                </li>
                <li class="advancedQuery" >            
                    <a id="advancedQuery"href="javascript:void(0);"   onclick="openAdvanced(navTab.getCurrentPanel())">
                        <@label key="advancedQuery.C">高级查询</@label>
                    </a>
                    <span  onclick="openAdvanced(navTab.getCurrentPanel());"></span>            
                </li>
            </ul>
    </div>
    </div>

<div id="collapsablePanel" style="display:none;"class="pageHeader" >

    <div class="searchBar">
        <ul class="searchContent">
            <li><label id="failureCode"><@label key="failureCode.C,colon">故障代码：</@label></label> 
                <input type="text" name="failureCode" value="${condition.failureCode!''}" />
            </li>
            <li><label id="failureText"><@label key="failureText.C,colon">故障描述：</@label></label> 
                <input type="text" name="failureText" value="${condition.failureText!''}" />
            </li>
            <li>
                <label>
                    <@label key='department.C,colon'>部门：</@label>
                </label>
                <input type="text" name="department" value="${condition.department!''}"/>
            </li>
        </ul>
        <ul class="searchContent">
            <li>
                <label>
                    <@label key='createDateTime.C,colon'>创建日期从：</@label>
                </label>
            
                    <input type="text" class="date" readonly="readonly" size="17" max_Date="{maxCreateDateTime}"  name="minCreateDateTime" value="${condition.minCreateDateTime!''}"/>
                    <a class="inputDateButton" href="javascript:;">选择</a>
            </li>
            <li>
                <label>
                    <@label key="to.C,colon">至：</@label>
                </label>
                
                    <input type="text" class="date" readonly="readonly" size="17" min_Date="{minCreateDateTime}" name="maxCreateDateTime"  value="${condition.maxCreateDateTime!''}"/>
                    <a class="inputDateButton" href="javascript:;">选择</a>
            </li>
            <li>
                <label>
                    <@label key='createUser.C,colon'>创建人：</@label>
                </label>
                <input type="text" name="createUser" value="${condition.createUser!''}"/>
            </li>
        </ul>
        <ul class="searchContent">
            <li>
                <label>
                    <@label key='modifyDateTime.C,colon'>修改日期从：</@label>
                </label>
                
                    <input type="text" class="date" readonly="readonly" size="17"  max_Date="{maxModifyDateTime}" name="minModifyDateTime" value="${condition.minModifyDateTime!''}"/>
                    <a class="inputDateButton" href="javascript:;">选择</a>
            </li>
            <li>    
                <label>
                    <@label key="to.C,colon">至：</@label>
                </label>
                
                    <input type="text" class="date" readonly="readonly" size="17" min_Date="{minModifyDateTime}" name="maxModifyDateTime"  value="${condition.maxModifyDateTime!''}"/>
                    <a class="inputDateButton" href="javascript:;">选择</a>
            </li>
            <li>
                <label>
                    <@label key='modifyUser.C,colon'>修改人：</@label>
                </label>
                <input type="text" name="modifyUser" value="${condition.modifyUser!''}"/>
            </li>
        </ul>
        <ul class="searchContent">
            <li>
                <label>
                    <@label key='requestDateTime.C,colon'>报修日期从：</@label>
                </label>
                    <input type="text" class="date" readonly="readonly" size="17"  max_Date="{maxRequestDateTime}" name="minRequestDateTime" value="${condition.minRequestDateTime!''}"/>
                    <a class="inputDateButton" href="javascript:;">选择</a>
            </li>
            <li>    
                <label>
                    <@label key="to.C,colon">至：</@label>
                </label>
                    <input type="text" class="date" readonly="readonly" size="17" min_Date="{minRequestDateTime}" name="maxRequestDateTime"  value="${condition.maxRequestDateTime!''}"/>
                    <a class="inputDateButton" href="javascript:;">选择</a>
            </li>
        </ul>
    </div>
</div>
</form>

<div class="pageContent">

    <div class="panelBar">
        <ul class="toolBar">
        <#if step??&&step==0>
            <@buttonRight menuCode="requestRepair_add" labelKey="add.B" defalutName="新增">
            <li><a class="add" target="dialog" mask="true" width="650" height="260" rel="addRequestRepair_tab"  href="${rc.getContextPath()}/manage/equipmentRepair/addRequestRepair?navTabId=${navTabId!''}"title="<@label key='addRepairOrder.D'>新增维修单</@label>" ><span><@label key="add.B">新增</@label></span></a></li></@buttonRight>
            <@buttonRight menuCode="requestRepair_edit" labelKey="edit.B" defalutName="编辑" >
            <li><a class="edit" target="dialog" mask="true" width="650" height="330" rel="editRequestRepair_tab" preevent="preModifyRepairOrder" 
            href="${rc.getContextPath()}/manage/equipmentRepair/modifyRequestRepair?id={repairOrderRepair_id}&navTabId=${navTabId!''}" title="<@label key='editRepairOrder.D'>编辑维修单</@label>"><span><@label key="edit.B">编辑</@label></span></a></li></@buttonRight>
            <@buttonRight menuCode="requestRepair_view" labelKey="view.B" defalutName="详情">
            <li><a class="icon" target="dialog" mask="true" width="660" height="340" rel="viewRequestRepair_tab"
            href="${rc.getContextPath()}/manage/equipmentRepair/viewRequestRepair?id={repairOrderRepair_id}&navTabId=${navTabId!''}"title="<@label key='viewRepairOrder.D'>维修单详情</@label>"><span><@label key="view.B">详情</@label></span></a></li></@buttonRight>
            <@buttonRight menuCode="requestRepair_del">
            <li><a class="do" target="dialog" mask="true" width="660" height="325" rel="startTask_tab"
            href="${rc.getContextPath()}/manage/equipmentRepair/submitRepairOrder?id={repairOrderRepair_id}&navTabId=${navTabId!''}" title="<@label key='startTask.B'>启动流程</@label>" ><span><@label key="requestRepair.B">报修</@label></span></a></li></@buttonRight>
            <@buttonRight menuCode="requestRepair_del">
            <li><a class="icon" target="dialog" mask="true" width="860" height="500" rel="viewTask_tab" preevent="preShowBussinessImg"
            href="${rc.getContextPath()}/manage/equipmentRepair/showBusinessImg?id={repairOrderRepair_id}&navTabId=${navTabId!''}"><span><@label key='viewRepairOrderProcess.B'>查看维修流程</@label></span></a></li></@buttonRight>
            <@buttonRight menuCode="requestRepair_del">
            <li><a class="delete" target="selectedTodo" href="${rc.getContextPath()}/manage/equipmentRepair/deleteRequestRepair?navTabId=${navTabId!''}" postType="string" rel="ids" callback="batchjobAjaxDone"
                title="<@label key='confirmDelRepairOrder.M'>确认要删除选择的报修单吗？</@label>"><span><@label key="delete.B">删除</@label></span>
            </a>
            </li>
            </@buttonRight>
        </#if>
        
    
        <#if step??&&step==4>
        <@buttonRight menuCode="EquipmentRepair_view" labelKey="view.B" defalutName="详情">
            <li><a class="icon" target="dialog" mask="true" width="680" height="530" rel="repairOrder_tab"
            href="${rc.getContextPath()}/manage/equipmentRepair/viewRepairOrder?id={repairOrderRepair_id}&navTabId=${navTabId!''}"title="<@label key='viewRepairOrder.D'>维修单详情</@label>"><span><@label key="view.B">详情</@label></span></a></li>
            </@buttonRight>
        </#if>
        </ul>
    </div>
    <table class="table" <#if step??&&step&gt;=3>width="160%"<#else>width="100%"</#if> layoutH="160">
        <thead>
            <tr>
            <#if step??&&step!=4>
                <th width="25"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
            </#if>    
                <th width="40"><@label key="serialNumber.C">序号</@label></th>
                <th width="120" orderField="orderCode"<#if (page.orderField?? && page.orderField == 'orderCode')>class="${page.orderDirection!''}"</#if>><@label key='repairOrderCode.C'>报修单号</@label></th>
                <th width="110" orderField="equipmentCode"<#if (page.orderField?? && page.orderField == 'equipmentCode')>class="${page.orderDirection!''}"</#if>><@label key='equipmentCode.C'>设备编号</@label></th>
                <th width="100" orderField="equipmentText"<#if (page.orderField?? && page.orderField == 'equipmentText')>class="${page.orderDirection!''}"</#if>><@label key='equipmentText.C'>设备名称</@label></th>
                <th width="100" orderField="department"<#if (page.orderField?? && page.orderField == 'department')>class="${page.orderDirection!''}"</#if>><@label key="department.C">部门</@label></th>
                <th width="80" orderField="failureCode"<#if (page.orderField?? && page.orderField == 'failureCode')>class="${page.orderDirection!''}"</#if>><@label key='failureCode.C'>故障代码</@label></th>
                <th width="100" orderField="failureText"<#if (page.orderField?? && page.orderField == 'failureText')>class="${page.orderDirection!''}"</#if>><@label key="failureText.C">故障描述</@label></th>
                <th width="70" ><@label key="processStatus.C">流程状态</@label></th>
                <th width="70" orderField="statusECode"<#if (page.orderField?? && page.orderField == 'statusECode')>class="${page.orderDirection!''}"</#if>><@label key='repairStatusECode.C'>处理状态</@label></th>
                <th width="100" orderField="requestUser"<#if (page.orderField?? && page.orderField == 'requestUser')>class="${page.orderDirection!''}"</#if>><@label key="requestUser.C">报修人</@label></th>
                <th width="120" orderField="requestDateTime"<#if (page.orderField?? && page.orderField == 'requestDateTime')>class="${page.orderDirection!''}"</#if>><@label key="requestDateTime.C">报修时间</@label></th>
                <th width="120" orderField="shutdownStartDatetime"><@label key="shutdownStartDatetime.C">停线开始时间</@label></th>
                <th width="120" orderField="shutdownEndDatetime"><@label key="shutdownStartDatetime.C">停线结束时间</@label></th>
                <#if step??&&step&gt;=2>
                <th width="100" orderField="receiveUser"<#if (page.orderField?? && page.orderField == 'receiveUser')>class="${page.orderDirection!''}"</#if>><@label key="receiveUser.C">接单人</@label></th>
                <th width="120" orderField="receiveDateTime"<#if (page.orderField?? && page.orderField == 'receiveDateTime')>class="${page.orderDirection!''}"</#if>><@label key="receiveDateTime.C">接单时间</@label></th>
                </#if>
                <#if step??&&step&gt;=3>
                <th width="100" orderField="repairUser"<#if (page.orderField?? && page.orderField == 'repairUser')>class="${page.orderDirection!''}"</#if>><@label key="repairUser.C">维修人</@label></th>
                <th width="120" orderField="repairStartDateTime"<#if (page.orderField?? && page.orderField == 'repairStartDateTime')>class="${page.orderDirection!''}"</#if>><@label key="repairStartDateTime.C">维修开始时间</@label></th>
                <th width="120" orderField="repairEndDateTime"<#if (page.orderField?? && page.orderField == 'repairEndDateTime')>class="${page.orderDirection!''}"</#if>><@label key="repairEndDateTime.C">维修结束时间</@label></th>
                <th width="100" orderField="repairMemo"<#if (page.orderField?? && page.orderField == 'repairMemo')>class="${page.orderDirection!''}"</#if>><@label key="repairMemo.C">维修内容</@label></th>
                <th width="100" orderField="repairResult"<#if (page.orderField?? && page.orderField == 'repairResult')>class="${page.orderDirection!''}"</#if>><@label key="repairResult.C">维修结果</@label></th>
                </#if>
                <#if step??&&step&gt;=4>
                <th width="100" orderField="checkUser"<#if (page.orderField?? && page.orderField == 'checkUser')>class="${page.orderDirection!''}"</#if>><@label key="checkUser.C">验收人</@label></th>
                <th width="120" orderField="checkDateTime"<#if (page.orderField?? && page.orderField == 'checkDateTime')>class="${page.orderDirection!''}"</#if>><@label key="checkDateTime.C">验收时间</@label></th>
                <th width="100" orderField="checkMemo"<#if (page.orderField?? && page.orderField == 'checkMemo')>class="${page.orderDirection!''}"</#if>><@label key="checkMemo.C">验收内容</@label></th>
                <th width="100" orderField="checkResult"<#if (page.orderField?? && page.orderField == 'checkResult')>class="${page.orderDirection!''}"</#if>><@label key="checkResult.C">验收结果</@label></th>
                </#if>
                
            </tr>
        </thead>
        <tbody>
        <#if page??><#if (page.data?size>0)> <#list page.data as repairOrder>
            <tr target="repairOrderRepair_id" rel="${repairOrder.orderCode!''}">
              <#if step??&&step!=4>
                <td><input name="ids" value="${repairOrder.orderCode!''}" type="checkbox"></td>
              </#if>
                <td>${page.startRow + repairOrder_index}</td>
                <td>${repairOrder.orderCode!''}</td>
                <td>${repairOrder.equipmentCode!''}</td>
                <td>${repairOrder.equipmentText!''}</td>
                <td>${repairOrder.department!''}</td>
                <td>${repairOrder.failureCode!''}</td>
                <td>${repairOrder.failureText!''}</td>
                <td><#if processECode??>
                        <#list processECode as processeCode>
                             <#if  repairOrder.processStatus==processeCode.eCode>
                                 ${processeCode.eCodeText!''}
                             </#if>
                        </#list>
                    </#if>
                </td>
                <td>
                    <#if ECode??>
                        <#list ECode as eCode>
                             <#if  repairOrder.statusECode==eCode.eCode>
                                 ${eCode.eCodeText!''}
                             </#if>
                        </#list>
                    </#if>
                </td>
                <td>${repairOrder.requestUser!''}</td>
                <td>${(repairOrder.requestDateTime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                <td>${(repairOrder.shutdownStartDatetime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                <td>${(repairOrder.shutdownEndDatetime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                <#if step??&&step&gt;=2>
                <td>${repairOrder.receiveUser!''}</td>
                <td>${(repairOrder.receiveDateTime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                </#if>
                <#if step??&&step&gt;=3>
                <td>${repairOrder.repairUser!''}</td>
                <td>${(repairOrder.repairStartDateTime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                <td>${(repairOrder.repairEndDateTime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                <td>${repairOrder.repairMemo!''}</td>
                <td>${repairOrder.repairResult!''}</td>
                </#if>
                <#if step??&&step&gt;=4>
                <td>${repairOrder.checkUser!''}</td>
                <td>${(repairOrder.checkDateTime?string("yyyy-MM-dd HH:mm"))?if_exists}</td>
                <td>${repairOrder.checkMemo!''}</td>
                <td>${repairOrder.checkResult!''}</td>
                </#if>
            </tr>
        </#list>
        <#else>
        <tr>
                <td colspan="20" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
        </tr>
        </#if>
        <#else>
        <tr>
                <td colspan="20" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
        </tr>
        </#if>
        </tbody>
    </table>
    <#include "/common/panelBar.html">
</div>

<script type="text/javascript">
$(function() {
    initAdvancedQuery(navTab.getCurrentPanel());
});
 function preShowBussinessImg(){
    var id = $("#repairOrderRepair_id", navTab.getCurrentPanel()).val();
    var enableFlag=true;
    if(id && id!=""){
        $.ajax({
            async : false,
            dataType : "json",
            url:hostUrl +"/equipmentRepair/preShowBussinessImg",
            data:{'orderCode':id},
            success:function(data){
                if(data.statusCode == DWZ.statusCode.error){
                    alertMsg.error(data.message);
                    enableFlag=  false;
                }
            }
        });
    }
    
    return enableFlag;
} 

 function preModifyRepairOrder(){
    var id = $("#repairOrderRepair_id", navTab.getCurrentPanel()).val();
    var enableFlag=true;
    if(id && id!=""){
        $.ajax({
            async : false,
            dataType : "json",
            url:hostUrl +"/equipmentRepair/preModifyRepairOrder",
            data:{'orderCode':id},
            success:function(data){
                if(data.statusCode == DWZ.statusCode.error){
                    alertMsg.error(data.message);
                    enableFlag= false;
                }
            }
        });
    }
    return enableFlag;
} 



</script>

